<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .container {
            width: 800px;
            height: 40px;
            border: 1px solid #333;
            margin: 30px auto;
        }

        table {
            width: 800px;
            margin: 0 auto;
            text-align: center;
        }

        tbody>tr:nth-child(odd) {
            background-color: greenyellow;
        }

        tbody>tr:nth-child(even) {
            background-color: skyblue;
        }

        tbody>tr:hover {
            background-color: #ccc;
        }
    </style>
</head>

<body>
    <div id="root"></div>
    <div id="tableRoot">
        <table border="1" cellspacing="0">
            <thead>
                <tr>
                    <th>序号</th>
                    <th>学生ID</th>
                    <th>学生姓名</th>
                    <th>学生年龄</th>
                    <th>学生性别</th>
                    <th>学生班级</th>
                    <th>学生薪水</th>
                </tr>
            </thead>
            <tbody></tbody>
        </table>
    </div>

    <script src="../../../tools/mathtool.js"></script>
    <script src="../../../tools/data_structure.js"></script>
    <script src="../../../tools/styletool.js"></script>
    <script src="../../../tools/mytable.js"></script>

    <script>
        /* 造1234条学生数据 */
        const students = createStudents(1234)
        console.log(students);

        const mt = new MyTable(
            tableRoot,
            students,
            {
                // thead: ["ID", "姓名", "年龄", "性别", "班级", "薪水"],

                // 使用使用默认布局（布局+样式）
                useDefaultLayout: false,
            }
        )
    </script>

</body>

</html>